package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

public class CollectionDemo1 {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
//        Collection<String> c = new HashSet<>();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        boolean b = c.add("five");
        System.out.println(b);

        System.out.println(c);
        System.out.println(c.size());
        System.out.println(c.isEmpty());

        c.clear();
        System.out.println(c);
        System.out.println(c.isEmpty());
        System.out.println(c.size());
    }
}
